<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head th:replace="_userFragment :: head(~{::title})">
    <meta charset="UTF-8" />
    <title>经济困难认定申请</title>
    <link rel="stylesheet" href="../static/layui/css/layui.css" />
    <link rel="stylesheet" href="../static/css/main.css" />
    <script src="../static/layui/layui.js"></script>
  </head>
  <body>
    <!--头部导航部分-->
    <div class="header" th:replace="_userFragment :: topmenu">
      <div class="layui-col-md10">
        <span id="header-font">贫困生资助系统</span>
      </div>
      <ul class="layui-nav layui-col-md2">
        <li class="layui-nav-item" style="float: right">
          <a href=""><img src="//t.cn/RCzsdCq" class="layui-nav-img" />我</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">修改信息</a></dd>
            <dd><a href="javascript:;">安全管理</a></dd>
            <dd><a href="javascript:;">退了</a></dd>
          </dl>
        </li>
      </ul>
    </div>
    <!--主要内容部分-->
    <div class="layui-row">
      <!--左侧导航-->
      <ul
        th:replace="_userFragment :: leftmenu(4)"
        class="layui-nav layui-nav-tree layui-col-md2"
        lay-filter="demo"
        style="height: 662px"
      >
        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;"><i class="layui-icon">&#xe770;</i> 个人中心</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">我的申请</a></dd>
            <dd><a href="javascript:;">用户信息</a></dd>
            <dd><a href="studentInfo.html">学生信息</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;"
            ><i class="layui-icon">&#xe6b2;</i> 经济困难认定</a
          >
          <dl class="layui-nav-child">
            <dd class="layui-this">
              <a href="javascript:;">经济困难认定申请</a>
            </dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;"><i class="layui-icon">&#xe857;</i> 资助管理</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">申请资助</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;"><i class="layui-icon">&#xe631;</i> 系统管理</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">修改密码</a></dd>
          </dl>
        </li>
      </ul>
      <!--右侧内容-->
      <div class="layui-col-md10">
        <fieldset
          class="layui-elem-field layui-field-title"
          style="margin-top: 30px"
        >
          <legend>经济困难认定申请</legend>
        </fieldset>
        <!--表单-->
        <form
          th:if="${hard?.hardResult=='待认定'||hard==null}"
          class="layui-form"
          action="/addHardApply"
          method="post"
        >
          <!-- 特殊条件信息 -->
          <div class="layui-form-item">
            <label class="layui-form-label">特殊条件</label>
            <div class="layui-input-block">
              <div
                class="layui-card"
                style="background-color: #f8f8f8; padding: 10px"
              >
                <div class="layui-card-body">
                  <div class="layui-row">
                    <div class="layui-col-md4">
                      <span
                        >孤残：<span
                          th:text="${session.student.specialOad ? '是 (20分)' : '否 (0分)'}"
                          th:style="${session.student.specialOad ? 'color: #FF5722; font-weight: bold;' : ''}"
                        ></span
                      ></span>
                    </div>
                    <div class="layui-col-md4">
                      <span
                        >单亲：<span
                          th:text="${session.student.specialSp ? '是 (20分)' : '否 (0分)'}"
                          th:style="${session.student.specialSp ? 'color: #FF5722; font-weight: bold;' : ''}"
                        ></span
                      ></span>
                    </div>
                    <div class="layui-col-md4">
                      <span
                        >烈士子女：<span
                          th:text="${session.student.specialCom ? '是 (20分)' : '否 (0分)'}"
                          th:style="${session.student.specialCom ? 'color: #FF5722; font-weight: bold;' : ''}"
                        ></span
                      ></span>
                    </div>
                  </div>
                  <div class="layui-row" style="margin-top: 10px">
                    <div class="layui-col-md4">
                      <span
                        >优抚对象：<span
                          th:text="${session.student.specialFo ? '是 (20分)' : '否 (0分)'}"
                          th:style="${session.student.specialFo ? 'color: #FF5722; font-weight: bold;' : ''}"
                        ></span
                      ></span>
                    </div>
                    <div class="layui-col-md4">
                      <span
                        >低保家庭：<span
                          th:text="${session.student.specialSa ? '是 (20分)' : '否 (0分)'}"
                          th:style="${session.student.specialSa ? 'color: #FF5722; font-weight: bold;' : ''}"
                        ></span
                      ></span>
                    </div>
                    <div class="layui-col-md4">
                      <span style="font-weight: bold"
                        >总分：
                        <span
                          th:with="score=${(session.student.specialOad ? 20 : 0) + 
                                           (session.student.specialSp ? 20 : 0) + 
                                           (session.student.specialCom ? 20 : 0) + 
                                           (session.student.specialFo ? 20 : 0) + 
                                           (session.student.specialSa ? 20 : 0)}"
                          th:text="${score + '分'}"
                          th:style="${score > 0 ? 'color: #01AAED; font-size: 16px;' : ''}"
                        >
                        </span>
                      </span>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">申请理由</label>
            <div class="layui-input-block">
              <textarea
                name="hardText"
                placeholder="请输入申请理由"
                lay-verify="required"
                class="layui-textarea"
              >
[[${hard?.hardReason}]]</textarea
              >
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="formDemo">
                立即提交
              </button>
              <button type="reset" class="layui-btn layui-btn-primary">
                重置
              </button>
            </div>
          </div>
        </form>
        <div
          th:if="${hard?.hardResult=='通过'||hard?.hardResult=='未通过'}"
          style="margin-left: 10px"
        >
          <div class="layui-card-header">
            <i class="layui-icon" style="color: #5fb878">&#x1005;</i> 已认定
          </div>
          <!-- 特殊条件信息（已认定状态） -->
          <div class="layui-card-header">特殊条件：</div>
          <div class="layui-card-body" style="margin-bottom: 10px">
            <table class="layui-table" style="margin-top: 0">
              <thead>
                <tr>
                  <th>条件类型</th>
                  <th>状态</th>
                  <th>得分</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>孤残</td>
                  <td
                    th:text="${session.student.specialOad ? '是' : '否'}"
                    th:style="${session.student.specialOad ? 'color: #FF5722; font-weight: bold;' : ''}"
                  ></td>
                  <td
                    th:text="${session.student.specialOad ? '20分' : '0分'}"
                  ></td>
                </tr>
                <tr>
                  <td>单亲</td>
                  <td
                    th:text="${session.student.specialSp ? '是' : '否'}"
                    th:style="${session.student.specialSp ? 'color: #FF5722; font-weight: bold;' : ''}"
                  ></td>
                  <td
                    th:text="${session.student.specialSp ? '20分' : '0分'}"
                  ></td>
                </tr>
                <tr>
                  <td>烈士子女</td>
                  <td
                    th:text="${session.student.specialCom ? '是' : '否'}"
                    th:style="${session.student.specialCom ? 'color: #FF5722; font-weight: bold;' : ''}"
                  ></td>
                  <td
                    th:text="${session.student.specialCom ? '20分' : '0分'}"
                  ></td>
                </tr>
                <tr>
                  <td>优抚对象</td>
                  <td
                    th:text="${session.student.specialFo ? '是' : '否'}"
                    th:style="${session.student.specialFo ? 'color: #FF5722; font-weight: bold;' : ''}"
                  ></td>
                  <td
                    th:text="${session.student.specialFo ? '20分' : '0分'}"
                  ></td>
                </tr>
                <tr>
                  <td>低保家庭</td>
                  <td
                    th:text="${session.student.specialSa ? '是' : '否'}"
                    th:style="${session.student.specialSa ? 'color: #FF5722; font-weight: bold;' : ''}"
                  ></td>
                  <td
                    th:text="${session.student.specialSa ? '20分' : '0分'}"
                  ></td>
                </tr>
                <tr>
                  <td colspan="2" style="text-align: right; font-weight: bold">
                    总分：
                  </td>
                  <td
                    th:with="score=${(session.student.specialOad ? 20 : 0) + 
                                    (session.student.specialSp ? 20 : 0) + 
                                    (session.student.specialCom ? 20 : 0) + 
                                    (session.student.specialFo ? 20 : 0) + 
                                    (session.student.specialSa ? 20 : 0)}"
                    th:text="${score + '分'}"
                    th:style="${score > 0 ? 'color: #01AAED; font-weight: bold;' : ''}"
                  ></td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="layui-card-header">认定结果：[[${hard.hardResult}]]</div>
          <div class="layui-card-body">
            申请理由：<br />
            [[${hard.hardReason}]]
          </div>
        </div>
      </div>
    </div>
  </body>
  <script>
    layui.use("element", function () {});
    layui.use("form", function () {});
    //弹出消息
    layui.use("layer", function () {
      var layer = layui.layer;
      var msg = "[[${msg}]]";
      if (msg != null && msg != "") {
        layer.msg(msg);
      }
    });
  </script>
</html>
